<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>定位</title>
</head>
<body>
	<section id='block-area'>
		
	</section>
	<script>
		window.onload = function() {

			var geo = navigator.geolocation;

			// 获取用户的地理位置
			geo.getCurrentPosition(function(position) {
				console.log(position);
				alert(true);
			},
			function(position) {
				console.log(position);
				alert(false);
			});
		};
	</script>
</body>
</html>